package com.generator.base;


import lombok.AllArgsConstructor;
import lombok.Getter;


/**
 * @author WangGuiXing
 */

@Getter
@AllArgsConstructor
public enum ResultEnum {
    // 成功
    SUCCESS(200, "成功"),
    // token异常  3开头
    TOKEN_PAST(301, "token过期"),
    TOKEN_ERROR(302, "token异常"),
    // 登录异常
    LOGIN_ERROR(303, "登录异常"),
    LOGIN_LOCK(304, "用户被禁用"),

    LOGIN_NAME(305, "用户名错误"),
    LOGIN_NAME_NULL(306, "用户名为空"),
    LOGIN_PASSWORD(307, "密码错误"),
    LOGIN_CODE(308, "验证码错误"),
    LOGOUT_CODE(309, "退出失败，token 为空"),

    UN_AUTHORIZED(401, "未登录"),
    NO_AUTHORITY(403, "没有访问权限"),

    // crud异常，6开头
    CRUD_SAVE_FAIL(603, "添加失败"),
    CRUD_UPDATE_FAIL(604, "更新失败"),
    CRUD_DELETE_FAIL(605, "删除失败"),
    CRUD_DELETE_NOT(606, "不允许删除"),
    CRUD_VALID_NOT(607, "字段校验异常"),
    CRUD_PARAM_NOT(608, "传入参数异常"),
    CRUD_NOT_OPERATE(601, "无操作权限"),
    CRUD_LOCK_OPERATE(609, "没有获取到锁"),
    CRUD_SELECT_FAIL(610, "查询失败"),
    // 默认错误
    ERROR(999, "错误"),
    
    ////////////////文件上传服务////////////////
    //文件上传服务 错误
    DOWNLOAD_ERROR(900,"文件下载异常"),
    OVER_MAX_SIZE_LIMIT(901,"上传文件大小超出上限"),
    USER_OSS_SERVICE_CLOSED(902,"用户云盘功能未开通"),
    UPLOAD_FILE_IS_NULL(903,"上传的文件为空"),
    UPLOAD_OSS_FAILED(905,"文件上传OSS失败"),
    UPLOAD_DATABASE_FAILED(906,"文件记录入库失败"),
    DELETE_OSS_FILE_FAILED(907,"文件不存在,删除失败"),
    //文件查询
    USER_FILE_TYPE_IS_NOT_VALID(908,"文件类型参数不合法"),
    DELETE_OSS_FILE_ERROR(909,"文件删除异常"),
    OVER_MAX_SPACE(950,"个人云盘空间不足,上传失败"),
    NOT_FIND_FILEPATH(910,"文件已过期,查看失败"),
    DATABASE_REDIS_NOT_CONSISTENT(911,"redis和数据库对该记录的状态不一致,请检查");

    private Integer code;

    private String desc;
}
